package cn.jtfadmin.base.lang.config.statuscode;

import cn.jtfadmin.base.lang.config.WebConfig;
import org.springframework.stereotype.Component;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * 缺省的异常错误码， 500
 *
 * @author jtf
 * @see ExceptionStatusCodeConfig
 * @see StatusCodeManager
 * @see WebConfig#configureHandlerExceptionResolvers(List)
 * @since 0.0.1
 */
@Component
public class DefaultErrorStatusCodeConfig implements ExceptionStatusCodeConfig {

    /**
     * 用户名或密码错误
     */
    public static final Integer ERROR = 500;
    public static final String ERROR_MSG = "服务器错误";


    public static final ExceptionStatusDescribe DEFAULT_ERROR_STATUS_DESCRIBE = new ExceptionStatusDescribe(ERROR_MSG, ERROR, Throwable.class);

    @Override
    public Set<ExceptionStatusDescribe> getExStatusDecribes() {
        Set<ExceptionStatusDescribe> set = new HashSet<>();
        set.add(DEFAULT_ERROR_STATUS_DESCRIBE);
        return set;
    }


}
